home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15477 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 5 Apr 1996 14:13:36 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4k3utg$ndp@solutions.solon.com>
  8. References: <JSA.96Feb16135027@organon.com> <emery-0204960656230001@line030.nwm.mindlink.net> <828632277snz@genesis.demon.co.uk> <dewar.828704810@schonberg>
  9. Reply-To: seebs@solon.com
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12. In article <dewar.828704810@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
  13. >Unix standards?????
  14.  
  15. You know, POSIX, Spec 1170, X/Open, that kind of stuff.  POSIX is the one the
  16. US govt. will not use Win NT because of, because it doesn't match the spec
  17. they've selected.
  18.  
  19. Begging pardon, but why does an obviously well-educated person feel the need
  20. to use multiple question marks on a query about something which has been
  21. common knowledge for at least a couple of years?  I've been seeing POSIX books
  22. for quite some time.
  23.  
  24. It seems as though you're a bit out of touch with the Unix world; you were
  25. amazed that Linux killed a program which did
  26.     read(fd, buf, nbytes);
  27. when buf wasn't large enough for nbytes, simply because the file
  28. didn't have nbytes left, and had less data than buf could hold.
  29. (This came up in a previous discussion.)
  30.  
  31. You were surprised when people pointed out that standard C allows an
  32. implementation to catch and prohibit attempts to modify the internals of a
  33. FILE, and that in fact, code which does so has ceased to be legal C.
  34.  
  35. You are constantly amazed by claims about standards for C or Unix which may be
  36. a year or more old.
  37.  
  38. I am getting the impression that you've not really taken the time to keep up
  39. with the standards community, and have been complaining about the excessive
  40. chumminess with the compiler that used to be considered normal and healthy in
  41. C.
  42.  
  43. It's not, anymore.  Linus Torvalds, a man who has probably written a fair
  44. amount of low-level code in C, some of it terriyingly optimized, was recently
  45. seen flaming people for advocating unportable tricks in C - tricks which work
  46. on *every* major C implementation currently in use.
  47.  
  48. I can certainly understand your position; I've seen C advocates talk about
  49. what Ada 83 did, and comparing it with C 89.  But it's not fair when they do
  50. it, and it's not fair when you do it, either, no matter *how* good you are.
  51. (And I must admit, by all accounts, you're quite good.)
  52.  
  53. Sometime, take a weekend or so to catch up with how modern C is
  54. written, what the standards do and don't guarantee, and look at
  55. some of the checks, warnings, and analyses available from modern
  56. C programming tools.  I think you'll find that C has matured
  57. quite a lot as a programming language since, say, 1983.
  58.  
  59. Most of your complaints about C and Unix match up strongly with
  60. the frustrations I had getting things to run on an SVR4/ANSI C
  61. environment in 1990 or so, when C was only a year old as a standardized
  62. language, and no one was really writing for it yet.  That was quite
  63. a while ago for this industry; right now, I can write "portable"
  64. programs and expect them to work on every commercial Unix, and
  65. every free Unix.  I don't have to think very hard to do it; I just
  66. write code the way I would anyway, and it magically works.
  67.  
  68. I occasionally have to put in some sort of sop for a broken system, but
  69. rarely; they're getting rarer, and I don't expect to even think about it in
  70. another couple of years.
  71.  
  72. -s
  73. -- 
  74. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  75. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  76. FUCK the communications decency act.  Goddamned government.  [literally.]
  77. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  78.